cmake_minimum_required(VERSION 3.10)
project(yolov11_trt)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CUDA_STANDARD 17)

set(CMAKE_PREFIX_PATH "C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.4/bin/nvcc.exe")
include_directories("C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.4/include")
# set(CUDA_ROOT "C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.4/")
# # 3. 告诉 CMake 优先用我们指定的目录
# set(CUDA_DIR "${CUDA_ROOT}/lib")   # vc16 = VS2019/2022
# find_package(CUDA REQUIRED)

# 2. 指定 OpenCV 安装根目录（!! 改成自己的路径 !!）
set(OPENCV_ROOT "D:/Harrytsz-Packages/Harrytsz-Opencv/harrytsz-opencv480/opencv/build/")
# 3. 告诉 CMake 优先用我们指定的目录
set(OpenCV_DIR "${OPENCV_ROOT}/x64/vc16/lib")   # vc16 = VS2019/2022
find_package(OpenCV REQUIRED)

# TensorRT
set(TENSORRT_ROOT "D:/Harrytsz-Packages/harrytsz-tensorrt/TensorRT/")   # 改成你的路径
include_directories(${TENSORRT_ROOT}/include)
link_directories(${TENSORRT_ROOT}/lib)
link_directories("C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.4/lib/x64")

add_executable(yolo11_trt main.cpp)
target_link_libraries(yolo11_trt
        ${OpenCV_LIBS}
        cudart
        nvinfer
        nvonnxparser
        cuda)